package com.yjd.comm.util;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

/**
 * 通用线程池
 * Created by yangchangyan on 2017/9/18.
 */
public class ThreadPoolUtil {

    private static int poolSize = 8;
    private static ExecutorService pool = Executors.newFixedThreadPool(poolSize);

    /**
     * 提交一个任务，支持获取执行结果
     *
     * @param
     * @return Future
     * @throws
     */
    public static Future submitTask(Runnable task){
        return pool.submit(task);
    }
}
